'''
 * @ author     ：廖传港
 * @ date       ：Created in 2020/11/5 20:53
 * @ description：
 * @ modified By：
 * @ ersion     : 
 * @File        : test.py 
'''
import joblib
import numpy as np
from com.lcg.version9 import Loading_pictures as lp
from com.lcg.version9 import model

X, Y = lp.loaddata("D:/python/data/data2/")

dnn = joblib.load("D:/python/data/model/model1.model")  # 加载模型


predictY = dnn.BatchPredict(X[150:200,])

print("predictY=", predictY)
predictYY = np.array([np.argmax(one_hot) for one_hot in predictY])
print("predictYY=", predictYY)
realY = Y[150:200]
print("realY",realY)
realYY = np.array([np.argmax(one_hot) for one_hot in realY])
print("realYY", realYY)
from sklearn.metrics import accuracy_score

# accuracy_score(predictYY, realYY)

print("准确数=",accuracy_score(predictYY, realYY, normalize=False))
print("准确率=",accuracy_score(predictYY, realYY))